var nav = document.querySelector(".nav")
        var list = document.querySelector(".list")
        console.log(list);
        const xhr1 = new XMLHttpRequest()
        xhr1.open("get","http://chst.vip:1234/api/getindexmenu",true);
        xhr1.send(null)
        xhr1.onreadystatechange = function(){
            if(xhr1.readyState===4 && xhr1.status===200){
                var res1 = JSON.parse(xhr1.responseText)
                console.log(res1);
                console.log(res1.result);
                let ele1 = "";
                res1.result.forEach(item => {
                    //console.log(item.img);
                    //console.log(item.name);
        
                    ele1 += `<div class="one" indexmenuId=${item.indexmenuId}>
                                <a href="./pages/${item.titlehref}">
                                ${item.img}
                                <p>${item.name}</p>
                                </a>
                            </div>`
                   
                    });
                    nav.innerHTML = ele1;
                $(".one:eq(7)").click(function(){
                    $(this).find("a").removeAttr("href").end().nextAll("div").slideToggle()
                })
            };

            }
        let xhr2 = new XMLHttpRequest();
        xhr2.open("get","http://chst.vip:1234/api/getmoneyctrl");
        xhr2.send();
        xhr2.onreadystatechange = function(){
            if(xhr2.readyState===4 && xhr2.status===200){
                var res2 = JSON.parse(xhr2.responseText)
                console.log(res2);
                console.log(res2.result);
                let ele2 = "";
                let regExp = /(?<=imgurl=)[^'"]*/;
                res2.result.forEach(item=>{
                    var img = regExp.exec(item.productImg2)[0]
                    console.log(item.productId);
                    ele2 += `<a href="./pages/discount.html?productid=${item.productId}" class="two">
                                    <div class="list_left">
                                        <img src="${img}" alt="">
                                    </div>
                                    <div class="list_right">
                                        <p>${item.productName}</p>
                                        <span>${item.productPinkage}</span>
                                        <div class="list_bottom">
                                            <span>${item.productFrom} |</span>
                                            <span>${item.productTime}</span>
                                            <i></i>
                                            <span>${item.productComCount}</span>
                                        </div> 
                                    </div>
                            </a>`
                })
                list.innerHTML = ele2;
            }
        }

        // $("div:eq(7)").prop("id","three")

        // 